package com.lee.boot.head.first.demo.entity;


import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * @author: Lee
 * @Date: 2018/10/26 10:17
 * @Description:
 */
@Document
public class Student implements Serializable {

    private static final long serialVersionUID = 4791408074654144739L;
    private String name;
    @JSONField(serialize = false)
    private Integer age;
    private List list;

    @Override
    public String toString() {
        if (null == list) {
            return "Student{" +
                    " name='" + name + '\'' +
                    ", age=" + age + '\'' +
                    ",list=" + null + '}';
        }
        return "Student{" +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", list=" + Arrays.toString(list.toArray()) +
                '}';
    }

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }


}

